project(XiliuMStar)

cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0005 NEW)

set(CMAKE_SKIP_BUILD_RPATH 0)
set(CMAKE_BUILD_WITH_INSTALL_RPATH 0)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/macros")

if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif()

include(CheckCXXSourceRuns)
include(CheckIncludeFiles)
include(cmake/options.cmake)

if (NOPCH) set(USE_COREPCH 0) set(USE_SCRIPTPCH 0) endif()

include(CheckPlatform)

find_package(PCHSupport)
find_package(ACE REQUIRED)
find_package(OpenSSL REQUIRED)

if (NOT USE_MYSQL_SOURCES) find_package(MySQL REQUIRED) endif()
if (UNIX) find_package(Readline) find_package(ZLIB) find_package(BZip2) endif()

include(cmake/genrev.cmake)
include(cmake/showoptions.cmake)

add_subdirectory(dep)
add_subdirectory(src)
add_subdirectory(sql)
